package com.mht.book.operation.impl;

import com.mht.book.entity.book.Book;
import com.mht.book.entity.book.BookList;
import com.mht.book.operation.Operations;
/**
 * @author wangfusheng
 * @version 1.0.0
 * @ClassName ShowBooksOperation.java
 * @Description 展示书架中所有的图书信息
 * @createTime 2022/12/316:21
 */
public class ShowBooksOperation implements Operations {
    @Override
    public void work(BookList bookList) {
        System.out.println("展示图书！");
        for (int i = 0; i < bookList.getUsedSize(); i++) {
            System.out.println("---------------------------------------------------");
            System.out.println(bookList.getBooks()[i]);
            if(i == bookList.getUsedSize()-1){
                System.out.println("---------------------------------------------------");
            }
        }
        System.out.println();
    }
    //测试方法是否正确
//    public static void main(String[] args) {
//        ShowBooksOperation show = new ShowBooksOperation();
//        show.work(new BookList());
//    }
}
